<template>
  <div class="Gallery" @click="handShow">
    <div class="w-100">
      <swiper :options="swiperOption">
        <swiper-slide v-for="(item,index) of imgs" :key="index">
          <img :src="item" class="w-100" alt>
        </swiper-slide>
        <div class="swiper-pagination" slot="pagination"></div>
      </swiper>
    </div>
  </div>
</template>

<script>
export default {
  name: "Gallery",
  props: {
    imgs: {
      type: Array,
      default() {
        return [];
      }
    }
  },
  data() {
    return {
      swiperOption: {
        autoplay: true,
        speed: 1000,
        pagination: {
          el: ".swiper-pagination",
          type: "fraction"
        },
        loop: true,
        observer: true,
        observeParents: true
      }
    };
  },
  methods: {
    handShow() {
      this.$emit("changeShow");
    }
  },
  components: {},
  mounted() {},
  computed: {}
};
</script>


<style scoped>
.Gallery {
  position: absolute;
  top: 0;
  left: 0;
  bottom: 0;
  right: 0;
  background: rgba(0, 0, 0, 1);
  color: #fff;
  display: flex;
  justify-content: center;
  align-items: center;
  z-index: 99;
}
</style>
